clang-tidy readability-else-after-return on gui.
authortsteven4 <tsteven4@gmail.com>
Sun, 3 Mar 2019 18:16:23 +0000 (11:16 -0700)
committertsteven4 <tsteven4@gmail.com>
Sun, 3 Mar 2019 18:16:23 +0000 (11:16 -0700)
and reformat fixes with astyle.

gui/gpx.cc
gui/mainwindow.cc
gui/optionsdlg.cc
gui/upgrade.cc

index 5256297d3c982889255ce4e2e0df64eaaaf7fd60..8ac65679a3948f1b07c1baf209decea3e949c596 100644 (file)
@@ -235,7 +235,7 @@ bool Gpx::read(const QString& fileName)
     tracks = gpxHandler.trkList;
     routes = gpxHandler.rteList;
     return true;
-  } else {
-    return false;
   }
+  return false;
+
 }
index d5e1bbbb1b58ac48b87f2925912bbd9971291e39..ae359bd4fb5e9da0a87d026673076b8cb9b7baeb 100644 (file)
@@ -226,9 +226,9 @@ MainWindow::MainWindow(QWidget* parent): QMainWindow(parent)
 //------------------------------------------------------------------------
 MainWindow::~MainWindow()
 {
-  
-    delete upgrade;
-  
+
+  delete upgrade;
+
 }
 //------------------------------------------------------------------------
 // Dynamic language switching courtesy of
@@ -854,8 +854,9 @@ bool MainWindow::isOkToGo()
   if (babelData_.outputType_ == BabelData::noType_ && !babelData_.previewGmap_) {
     QMessageBox::information(nullptr, QString(appName), tr("No valid output specified"));
     return false;
-  } else if (babelData_.outputType_ == BabelData::fileType_ &&
-             babelData_.outputFileName_.length() == 0) {
+  }
+  if (babelData_.outputType_ == BabelData::fileType_ &&
+      babelData_.outputFileName_.length() == 0) {
     QMessageBox::information(nullptr, QString(appName), tr("No output file specified"));
     return false;
   }
index 10df747cc2c674d59299204839385574b44aeedc..fd2f590cd8410045471a71ce55396d4f9f7eba40 100644 (file)
@@ -55,14 +55,14 @@ QVariant getOptionValue(QList<FormatOption> opts, int k)
 {
   if (opts[k].getValue().toString() != "") {
     return opts[k].getValue();
-  } else {
-    return opts[k].getDefaultValue();
   }
+  return opts[k].getDefaultValue();
+
 }
 
 //------------------------------------------------------------------------
 FileDlgManager::~FileDlgManager()
-= default;
+  = default;
 
 //------------------------------------------------------------------------
 void FileDlgManager::buttonClicked()
index 5dced128485a9b8d69db60905f3056eade58875d..8ce6b777d3ed54520da9fdbc1e03d99b3355e713 100644 (file)
@@ -175,7 +175,8 @@ void UpgradeCheck::httpRequestFinished(QNetworkReply* reply)
   if (reply == nullptr) {
     babelData_.upgradeErrors_++;
     return;
-  } else if (reply != replyId_) {
+  }
+  if (reply != replyId_) {
     QMessageBox::information(nullptr, tr("HTTP"),
                              tr("Unexpected reply."));
   } else if (reply->error() != QNetworkReply::NoError) {